﻿<?xml version="1.0" encoding="utf-8" ?>

<Rules FriendlyName="Sinacor+ Rules">
  
  <Rule TypeName="BaseResourceAccess" Category="BaseResourceAccess" CheckId="SINA0001">
    <Name>Check BaseResourceAccess</Name>
    <Description>Check BaseResourceAccess</Description>
    <Url></Url>
    <Resolution Name="BaseResourceAccessResolution">All Resource Access class must inherit from "BaseResourceAccess". Class: {0}. Namespace: {1}</Resolution>
    <MessageLevel Certainty="100">Error</MessageLevel>
    <Email></Email>
    <FixCategories>Breaking</FixCategories>
    <Owner>BMFBovespa</Owner>
  </Rule>

  <Rule TypeName="AttributesMethodsCheck" Category="AttributesMethodsCheck" CheckId="SINA0004">
    <Name>Check Methods Attributes</Name>
    <Description>Check Methods Attributes</Description>
    <Url></Url>
    <Resolution Name="GeneralFaultAttributeResolution">All contract methods must have the "[FaultContract(typeof(Sinacor.Infra.Service.ExceptionHandling.GeneralFault))]" attribute. Interface: {0}. Method: {1}. Namespace: {2}</Resolution>
    <Resolution Name="BusinessFaultAttributeResolution">All contract methods must have the "[FaultContract(typeof(Sinacor.Infra.Service.ExceptionHandling.BusinessFault))]" attribute. Interface: {0}. Method: {1}. Namespace: {2}</Resolution>
    <Resolution Name="ValidationFaultAttributeResolution">All contract methods must have the "[FaultContract(typeof(Sinacor.Infra.Service.ExceptionHandling.ValidationFault))]" attribute. Interface: {0}. Method: {1}. Namespace: {2}</Resolution>
    <Resolution Name="InvalidSessionFaultAttributeResolution">All contract methods must have the "[FaultContract(typeof(Sinacor.Infra.Service.ExceptionHandling.InvalidSessionFault))]" attribute. Interface: {0}. Method: {1}. Namespace: {2}</Resolution>
    <Resolution Name="LicensingFaultAttributeResolution">All contract methods must have the "[FaultContract(typeof(Sinacor.Infra.Service.ExceptionHandling.LicensingFault))]" attribute. Interface: {0}. Method: {1}. Namespace: {2}</Resolution>
    <Resolution Name="AccessIsDeniedFaultAttributeResolution">All contract methods must have the "[FaultContract(typeof(Sinacor.Infra.Service.ExceptionHandling.AccessIsDeniedFault))]" attribute. Interface: {0}. Method: {1}. Namespace: {2}</Resolution>
    <MessageLevel Certainty="100">Error</MessageLevel>
    <Email></Email>
    <FixCategories>Breaking</FixCategories>
    <Owner>BMFBovespa</Owner>
  </Rule>

  <Rule TypeName="BaseModel" Category="BaseModel" CheckId="SINA0007">
    <Name>Check BaseModel</Name>
    <Description>Check BaseModel</Description>
    <Url></Url>
    <Resolution Name="BaseModelResolution">All Model class must inherit from "BaseModel".  Class: {0}. Namespace: {1}</Resolution>
    <MessageLevel Certainty="100">Error</MessageLevel>
    <Email></Email>
    <FixCategories>Breaking</FixCategories>
    <Owner>BMFBovespa</Owner>
  </Rule>

  <Rule TypeName="ModelPropertyChanged" Category="ModelPropertyChanged" CheckId="SINA0008">
    <Name>Check PropertyChanged</Name>
    <Description>Check PropertyChanged Model class</Description>
    <Url></Url>
    <Resolution Name="ModelPropertyChangedResolution">All Model properties must call OnPropertyChanged event in Set method. Class: {0}. Property: {1}. Namespace: {2}</Resolution>
    <MessageLevel Certainty="100">Error</MessageLevel>
    <Email></Email>
    <FixCategories>Breaking</FixCategories>
    <Owner>BMFBovespa</Owner>
  </Rule>

  <Rule TypeName="ParameterMethodCommunication" Category="ParameterMethodCommunication" CheckId="SINA0009">
    <Name>Check Parameter Method Communication</Name>
    <Description>Check Parameter Method Communication</Description>
    <Url></Url>
    <Resolution Name="ParameterMethodCommunicationResolution">All Communication Methods must have as parameter a Model, ModelCollection or a simple parameter. Class: {0}. Method: {1}. Parameter: {2}. Namespace: {3}</Resolution>
    <MessageLevel Certainty="100">Error</MessageLevel>
    <Email></Email>
    <FixCategories>Breaking</FixCategories>
    <Owner>BMFBovespa</Owner>
  </Rule>

  <Rule TypeName="BaseCommunication" Category="BaseCommunication" CheckId="SINA0010">
    <Name>Check BaseCommunication</Name>
    <Description>Check BaseCommunication</Description>
    <Url></Url>
    <Resolution Name="BaseCommunicationResolution">All Communication class must inherit from "BaseCommunication". Class: {0}. Namespace: {1}</Resolution>
    <MessageLevel Certainty="100">Error</MessageLevel>
    <Email></Email>
    <FixCategories>Breaking</FixCategories>
    <Owner>BMFBovespa</Owner>
  </Rule>

  <Rule TypeName="DataContractRequestSuffix" Category="DataContractRequestSuffix" CheckId="SINA0021">
    <Name>Check Data Contract Request Suffix</Name>
    <Description>Check Data Contract Request Suffix</Description>
    <Url></Url>
    <Resolution Name="DataContractRequestSuffixResolution">All Data Contract Request class must have the "Request" suffix. Class: {0}. Namespace: {1}</Resolution>
    <MessageLevel Certainty="100">Error</MessageLevel>
    <Email></Email>
    <FixCategories>Breaking</FixCategories>
    <Owner>BMFBovespa</Owner>
  </Rule>

  <Rule TypeName="Suffix" Category="Suffix" CheckId="SINA0023">
    <Name>Check Suffix</Name>
    <Description>Check Suffix</Description>
    <Url></Url>
    <Resolution Name="AttributeSuffixResolution">All Attribute class must have the "Attribute" suffix. Class: {0}. Namespace: {1}</Resolution>
    <Resolution Name="EventArgsSuffixResolution">All EventArgs class must have the "EventArgs" suffix. Class: {0}. Namespace: {1}</Resolution>
    <Resolution Name="ExceptionSuffixResolution">All Exception class must have the "Exception" suffix. Class: {0}. Namespace: {1}</Resolution>
    <Resolution Name="DictionarySuffixResolution">All Dictionary class must have the "Dictionary" suffix. Class: {0}. Namespace: {1}</Resolution>
    <Resolution Name="CollectionSuffixResolution">All Collection class must have the "Collection" suffix. Class: {0}. Namespace: {1}</Resolution>
    <Resolution Name="PermissionSuffixResolution">All Permission class must have the "Permission" suffix. Class: {0}. Namespace: {1}</Resolution>
    <MessageLevel Certainty="100">Error</MessageLevel>
    <Email></Email>
    <FixCategories>Breaking</FixCategories>
    <Owner>BMFBovespa</Owner>
  </Rule>

  <Rule TypeName="EventHandlerSuffix" Category="EventHandlerSuffix" CheckId="SINA0025">
    <Name>Check EventHandler Suffix</Name>
    <Description>Check EventHandler Suffix</Description>
    <Url></Url>
    <Resolution Name="EventHandlerSuffixResolution">All EventHandler must have the "EventHandler" suffix. Class: {0}. Delegate: {1}. Namespace: {2}</Resolution>
    <MessageLevel Certainty="100">Error</MessageLevel>
    <Email></Email>
    <FixCategories>Breaking</FixCategories>
    <Owner>BMFBovespa</Owner>
  </Rule>

  <Rule TypeName="DelegateSuffix" Category="DelegateSuffix" CheckId="SINA0026">
    <Name>Check Delegate Suffix</Name>
    <Description>Check Delegate Suffix</Description>
    <Url></Url>
    <Resolution Name="DelegateSuffixResolution">Don't use suffix "Delegate" in delegates. Class: {0}. Delegate: {1}. Namespace: {2}</Resolution>
    <MessageLevel Certainty="100">Error</MessageLevel>
    <Email></Email>
    <FixCategories>Breaking</FixCategories>
    <Owner>BMFBovespa</Owner>
  </Rule>

  <Rule TypeName="DontInheritSystemEnum" Category="DontInheritSystemEnum" CheckId="SINA0028">
    <Name>Check Dont Inherit System Enum</Name>
    <Description>Check Dont Inherit System Enum</Description>
    <Url></Url>
    <Resolution Name="DontInheritSystemEnumResolution">Don't inherit from System.Enum. Class: {0}. Namespace: {1}</Resolution>
    <MessageLevel Certainty="100">Error</MessageLevel>
    <Email></Email>
    <FixCategories>Breaking</FixCategories>
    <Owner>BMFBovespa</Owner>
  </Rule>
  
  <Rule TypeName="ProjectDetails" Category="ProjectDetails" CheckId="SINA0030">
    <Name>Check ProjectDetails</Name>
    <Description>Check ProjectDetails</Description>
    <Url></Url>
    <Resolution Name="UIProjectNameResolution">Correct the project name. Project: {0}</Resolution>
    <Resolution Name="UIDefaultNameSpaceResolution">Correct the default namespace. Project: {0}</Resolution>
    <Resolution Name="UIOutputNameResolution">Correct the output name. Project: {0}</Resolution>
    <Resolution Name="ServiceProjectNameResolution">Correct the project name. Project: {0}</Resolution>
    <Resolution Name="ServiceDefaultNameSpaceResolution">Correct the default namespace. Project: {0}</Resolution>
    <Resolution Name="ServiceOutputNameResolution">Correct the output name. Project: {0}</Resolution>
    <MessageLevel Certainty="100">Error</MessageLevel>
    <Email></Email>
    <FixCategories>Breaking</FixCategories>
    <Owner>BMFBovespa</Owner>
  </Rule>
  
  <Rule TypeName="ControlPrefix" Category="ControlPrefix" CheckId="SINA0037">
    <Name>Check Control Prefix</Name>
    <Description>Check Control Prefix</Description>
    <Url></Url>
    <Resolution Name="ControlPrefixResolution">{0} control must have {1} prefix. Class: {2}. Namespace: {3}</Resolution>
    <MessageLevel Certainty="100">Error</MessageLevel>
    <Email></Email>
    <FixCategories>Breaking</FixCategories>
    <Owner>BMFBovespa</Owner>
  </Rule>

  <Rule TypeName="BovespaExceptionsThrownMustBeInfraException" Category="BovespaExceptionsThrownMustBeInfraException" CheckId="BOV1301">
    <Name>Bovespa Exceptions Thrown Must Be Infra Exception</Name>
    <Description>Bovespa Exceptions Thrown Must Be Infra Exception</Description>
    <Url></Url>
    <Resolution Name="BovespaExceptionsThrownMustBeInfraExceptionResolution">All thrown exceptions must be BusinessException, ValidationException or GeneralException type.</Resolution>
    <MessageLevel Certainty="100">Error</MessageLevel>
    <Email></Email>
    <FixCategories>Breaking</FixCategories>
    <Owner>BMFBovespa</Owner>
  </Rule>
  
  <Rule TypeName="BovespaMethodNamesMustBeOnInfinitiv" Category="BovespaMethodNamesMustBeOnInfinitiv" CheckId="BOV3005">
    <Name>Check BovespaMethodNamesMustBeOnInfinitiv</Name>
    <Description>Check BovespaExceptionsThrownMustBeInfraException</Description>
    <Url></Url>
    <Resolution Name="MethodNamesMustBeOnInfinitivResolution">The method names should be on infinitive. Class: {0}. Method: {1}. Namespace: {2}</Resolution>
    <MessageLevel Certainty="100">Error</MessageLevel>
    <Email></Email>
    <FixCategories>Breaking</FixCategories>
    <Owner>BMFBovespa</Owner>
  </Rule>
  
  <Rule TypeName="BovespaDoNotUseStaticFieldsAtViewPresenter" Category="BovespaDoNotUseStaticFieldsAtViewPresenter" CheckId="BOV5002">
    <Name>Check BovespaDoNotUseStaticFieldsAtViewPresenter</Name>
    <Description>Check BovespaDoNotUseStaticFieldsAtViewPresenter</Description>
    <Url></Url>
    <Resolution Name="DoNotUseStaticFieldsAtViewPresenterResolution">Static fields are not allowed in view/presenter projects. Class: {0}. Field: {1}. Namespace: {2}</Resolution>
    <Resolution Name="DoNotUseStaticPropertiesAtViewPresenterResolution">Static properties are not allowed in view/presenter projects. Class: {0}. Property: {1}. Namespace: {2}</Resolution>
    <MessageLevel Certainty="100">Error</MessageLevel>
    <Email></Email>
    <FixCategories>Breaking</FixCategories>
    <Owner>BMFBovespa</Owner>
  </Rule>

  <Rule TypeName="BovespaInterfaceNamespaceShouldMatchGuidelines" Category="BovespaDoNotUseStaticFieldsAtViewPresenter" CheckId="BOV5310">
    <Name>Check BovespaInterfaceNamespaceShouldMatchGuidelines</Name>
    <Description>Check BovespaInterfaceNamespaceShouldMatchGuidelines</Description>
    <Url></Url>
    <Resolution Name="InterfaceNamespaceShouldMatchGuidelinesResolution">Contract namespaces must match guidelines. Interface: {0}. Namespace: {1}</Resolution>
    <MessageLevel Certainty="100">Error</MessageLevel>
    <Email></Email>
    <FixCategories>Breaking</FixCategories>
    <Owner>BMFBovespa</Owner>
  </Rule>
    
</Rules>